#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
#define maxn 505

int s,n;
int x[maxn],y[maxn];
struct Edge {
	int u,v,w;
	bool operator< (Edge a){
		return this->w < a.w;
	}
};
vector<Edge> edge;
vector<Edge> selected_edge;
class UnionSet {
private:
	int father[maxn];
public:
	int find(int a){
		if(father[a]==a) return a;
		else return father[a] = find(father[a]);
	}
	void unite(int a, int b){
		int fa=find(a), fb=find(b);
		if(fa!=fb) father[fa]=fb;
	}
	UnionSet(){
		for(int i=0;i<maxn;i++){
			father[i]=i;
		}
	}
}us;

int main(){
	cin>>s>>n;
	for(int i=0;i<n;i++){
		cin>>x[i]>>y[i];
	}
	for(int i=0;i<n;i++){
		Edge e;
		for(int j=0;j<n;j++){
			int w = (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
			e.u=i; e.v=j; e.w=w;
			edge.push_back(e);
		}
	}
	sort(edge.begin(), edge.end());
	int m = n*n;
	for(int i=0;i<m;i++){
		Edge e=edge[i];
		int u=e.u, v=e.v, w=e.w;
		if(us.find(u) != us.find(v)){
			selected_edge.push_back(e);
			us.unite(u,v);
		}
	}
	float ans = sqrt((float)selected_edge[n-s-1].w);
	printf("%.2f\n",ans);
	return 0;
}
